<div class="page_head">
<span>
   <%=link_to "Delete".t,message_url(params[:project_id],@message),:confirm=>'Are you sure?',:method=>'delete',:class=>'admin'%>
   | <%= link_to 'Edit'.t, edit_message_path(@message.project,@message),:class=>'admin' %>
</span>
<h2>
  <%=h @message.name %>
</h2>
</div>

<div class='msg_prop'>
  <%="by ".t%> <%=h @message.user.name%>
  <%="in ".t + link_to(@message.category.name,project_msg_in_category_url(@project.id,@message.category.id)) if @message.category%>
  <%="on ".t + @message.created_at.strftime(LONGDATE)%>
</div>

<div class='msg_body'>
<%=CGI.unescapeHTML(@message.body)%>
</div>

<% if @message.files.size > 0 %>
<div class=extra>
<%@message.files.each do |f|%>
  <%=icon f.content_type%>
  <%=link_to "<strong>" + f.name + "</strong>(" + f.content_type + ")" + number_to_human_size(f.size),"/files/" + params[:project_id] + "/" + f.name%> 
  <%="in".t%> 
  <%=link_to f.category.name,project_file_in_category_url(@project.id,f.category.id) rescue link_to "uncategorized".t,project_file_in_category_url(@project.id,'uncat')%><br/>
<%end%>
</div>
<%end%>

<!--list comments-->
<div id='comments_list'>
  <%=render :partial=>'comments/list',:locals=>{:comments=>@message.comments}%>
</div>

<hr class=dashed>
<strong><%="Leave your comment...".t%></strong>
<!--add comment form-->
<%form_remote_for :comment,:url=>{:controller=>'comments',:action=>'create'} do |f|%>
  <%=f.text_area :body,:rows=>5,:cols=>"100%"%>
  <%=f.hidden_field :user_id,:value=>@cur_user.id%>
  <%=f.hidden_field :message_id,:value=>@message.id%>
  <div>
  <%=indicator('cm')%>
  <%=submit_tag "Post this comment".t,:id=>'sub_cm',:onclick=>"Element.show('indicator_cm');"%>
  </div>
<%end%>



